import { defineStore } from 'pinia'
import { ref } from 'vue'

export const boardOpenOrCloseStore = defineStore(
  'board',
  () => {
    const finalBoard = ref(false)
    const changeFinalBoard = (newV) => {
      finalBoard.value = newV
    }
    const countDownBoard = ref(false)
    const changeCountDownBoard = (newV) => {
      countDownBoard.value = newV
    }
    const speedBoard = ref(false)
    const changeSpeedBoard = (newV) => {
      speedBoard.value = newV
    }
    const reGame = ref(false)
    const changeReGame = (newV) => {
      reGame.value = newV
    }
    return {
      finalBoard,
      changeFinalBoard,
      countDownBoard,
      changeCountDownBoard,
      speedBoard,
      changeSpeedBoard,
      reGame,
      changeReGame,
    }
  },
  {
    persist: true,
  },
)
